package com.linkgie.galaxyframework.metric;

public class MetricIsolation {

    private static final MetricIsolation DISABLE = new MetricIsolation(false, null);

    private static final MetricIsolation DEFAULT = new MetricIsolation(true, null);

    private boolean enabled;

    private String providerName;

    
    /**
     * @return the enable
     */
    public boolean isEnabled() {
        return enabled;
    }

    /**
     * @return the providerName
     */
    public String getProviderName() {
        return providerName;
    }


    private MetricIsolation(boolean enable, String providerName){
        this.enabled = enable;
        this.providerName = providerName;
    }

    public static Builder provider(String name){
        return new Builder(name);
    }

    public static MetricIsolation enable(){
        return DEFAULT;
    }

    public static MetricIsolation disable(){
        return DISABLE;
    }



    public static class  Builder {
        
        private String providerName;


        private Builder(String providerName){
            this.providerName = providerName;
        }

        MetricIsolation enable(){
            return new MetricIsolation(true, providerName);
        }
        
    }


}
